import LoadingComponent from "./index.vue";
const Loading = {};
Loading.install = function(Vue) {
  const ToastConstructor = Vue.extend(LoadingComponent);
  const instance = new ToastConstructor();
  instance.$mount(document.createElement("div"));
  document.body.appendChild(instance.$el);
  //注入vue的原型链
  Vue.prototype.$loading = {
    show() {
      instance.show = true;
    },
    close() {
      instance.show = false;
    },
  };
};
export default Loading;
